package ObjectOutputStream_;

import java.io.Serializable;

/**
 * 序列化对象的时候.默认将对象的属性全部序列化
 */
public class Dog implements Serializable {
    private static final long serialVersionUID = 4945752153035897252L;
    private String name;
    //序列化对象的时候，会默认将将所有属性进行序列化。但除了Static或transient修饰的成员。
    private static String nation;
    private transient String color;

    public static String getNation() {
        return nation;
    }

    public static void setNation(String nation) {
        Dog.nation = nation;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public Dog() {
    }

    public Dog(String name, String color) {
        this.name = name;
        this.color = color;
    }


    public Dog(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
